import { CHANGE_TOP_BANNERS } from './constants'
import { getTopBanners } from '../../../../../services/recommend'
export const changTopBannerAction = payload => ({ type: CHANGE_TOP_BANNERS, payload })
export const getTopBannersAction = params => {
  return async (dispatch, getState) => {
    try {
      const { banners } = await getTopBanners()
      dispatch(changTopBannerAction(banners))
    } catch (error) {
      console.log(error, '请求banners数据出错')
    }
  }
}
